/*
 * Copyright @ 2024 weili23
 * com.itheima.mp.service 10:20
 * All right reserved.
 */

package com.itheima.mp.service;

import com.itheima.mp.utils.StoreFileReturn;
import io.minio.errors.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

/**
 * @desc: 文件公共接口
 * @author: weili23
 * @createTime: 2024/5/14 10:20
 * @version: v1.0
 */
public interface IFileCommonService {

    /**
     * @desc:文件上传
     * @author: weili23
     * @params:MultipartFile
     * @Date: 2024/5/14 10:21
     * @version: 1.0
     */
    StoreFileReturn uploadFile(MultipartFile file) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    /**
     * @desc:文件下载
     * @author: weili23
     * @params:String path
     * @Date: 2024/5/14 10:23
     * @version: 1.0
     */
    void downloadFile(String path, String name, HttpServletResponse response) throws IOException;

    /**
     * @desc:删除文件
     * @author: weili23
     * @params
     * @Date: 2024/5/16 10:23
     * @version: 1.0
     */
    void deleteFile(String path) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;
}
